<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script type="text/javascript" src="js/vue.js">
    </script>
</head>
<body>
    <div id="root">
        <h1>数组元素: {{arr[0]}}</h1>
        <h2>学校：{{name}}</h2>
        <h2>年龄：{{age}}</h2>
        <h2>班级：{{className}}</h2>
        <div v-text = "name">你好，</div><!--替换了整个文本-->
        <div>你好，{{name}}</div>
        <h2>num1:{{num1}}</h2>
        <h2>num2:{{num2}}</h2>
        

        <div v-html = "str" >你好，</div>
        <div v-text = "str">你好，</div><!--替换了整个文本-->

        <div>
            数据绑定1 <input type="text" v-bind:value="name">
            数据绑定1 <input v-model="name"><!--双向绑定 -->
        </div>
        <!--
        数字求和
        -->
        
        <div>
            <input v-model.number="num1"><!--双向绑定 -->
            +
            <input v-model.number="num2"><!--双向绑定 -->
            =
            {{num1+num2}}
        </div>
        <div id = "root1">
            <p v-if="type === 'A'">优秀</p>
            <p v-else-if="type === 'B'">良好</p>
            <p v-else>差</p>
        </div>

        <fieldset>
            <legend> v-once</legend>
            <p v-once> 有once不变{{name}}</p>
            <p> wuonce{{name}}</p>
            <!-- pre -->
             <p>v-pre:span</p>
        </fieldset>
        
    </div>
    
    <script type="text/javascript">
        
        new Vue({
            el:'#root1',
            data:{
                type:'A'
            }
        })
    </script>
    <script type="text/javascript">
        

        const vm = new Vue(
            {
                el:'#root',
                data:{
                    name:'徐以民',
                    age:'21',
                    arr:['usth','software'],
                    str:'<h3 style="color:aqua">黑龙江科技大学</h3>',
                    className:'软件22-3班'
                }
                
            }
        );
        const vm2 = new Vue({
            data() {
                return {
                    message:'sss'
                }

            }
        } );
        console.log(vm);
        vm.$mount('#root');       
    </script>
</body>
</html>